﻿Option Explicit On
Option Strict On

Imports System.ServiceModel
Imports System.Runtime.Serialization

Namespace Framework.Hardware

    ''' <summary>
    ''' Represents the current state of the ACOM2000A 
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable()> _
    <DataContract()> _
    Public Class AmplifierState

#Region " Private Members "

        Private m_ProtectionLED As LedStatus = LedStatus.Off 'The current state of the Protection LED
        Private m_HeaterLED As LedStatus = LedStatus.Off 'The current state of the Heater LED
        Private m_StandbyLED As LedStatus = LedStatus.Off 'The current state of the Standby LED
        Private m_OperateLED As LedStatus = LedStatus.Off 'The current state of the Operate LED
        Private m_DriveLED As LedStatus = LedStatus.Off 'The current state of the Drive LED
        Private m_PlateLED As LedStatus = LedStatus.Off 'The current state of the Plate LED
        Private m_PowerLED As LedStatus = LedStatus.Off 'The current state of the Power LED

        Private m_OperateMode As OperateMode = OperateMode.Standby 'The Current Operate mode of the amplifier

        Private m_CurrentAirTemp As Integer 'The current air temperature in Deg C

        Private m_PowerState As PowerState 'The Power/Connection state of the amplifier
        Private m_PowerStatePriorToError As PowerState 'The Power/Connection state of the amplifier prior to an amplifier error being generated

        Private m_Segment As BandSegment = Nothing 'The Amplifier's current band segment
        Private m_AntennaNumber As Integer = 0 'The Amplifier's current antenna number

        Private m_USRMode As Boolean 'True if the Amplifier is using USR settings, False if DEF is being used
        Private m_Band As FrequencyBand = FrequencyBand.Band160m 'The Amplifier's current band

        Private m_CurrentErrorMessageLine1 As String 'The First Matrix Display text line for the current error message
        Private m_CurrentErrorMessageLine2 As String 'The Second Matrix Display text line for the current error message

        Private m_CanConnect As Boolean = False 'Are we in a state where a connection could be established?

        'Matrix Display Lines
        Private m_DisplayLine1 As String = "    DISCONNECTED    " 'The current value of line 1 of the Matrix Display
        Private m_DisplayLine2 As String = "                    " 'The current value of line 2 of the Matrix Display
        Private m_DisplayLine3 As String = "                    " 'The current value of line 3 of the Matrix Display
        Private m_DisplayLine4 As String = "                    " 'The current value of line 4 of the Matrix Display

        'Measurement
        Private m_IsMeasuring As Boolean = False 'True if the amplifier is in measurement mode
        Private m_MetricA As MeasurementMetricType 'The first metric to measure
        Private m_MetricB As MeasurementMetricType 'The second metric to measure
        Private m_MetricAValue As String = "" 'The current value of the first measured metric
        Private m_MetricBValue As String = "" 'The current value of the second measured metric

#End Region

#Region " Public Properties"

        ''' <summary>
        ''' Are we in a state where a connection could be established?
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property CanConnect As Boolean
            Get
                Return m_CanConnect
            End Get
            Set(value As Boolean)
                m_CanConnect = value
            End Set
        End Property

        ''' <summary>
        ''' The current state of the Protection LED
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property ProtectionLED As LedStatus
            Get
                Return m_ProtectionLED
            End Get
            Set(ByVal value As LedStatus)
                m_ProtectionLED = value
            End Set
        End Property

        ''' <summary>
        ''' The current state of the Heater LED
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property HeaterLED As LedStatus
            Get
                Return m_HeaterLED
            End Get
            Set(ByVal value As LedStatus)
                m_HeaterLED = value
            End Set
        End Property

        ''' <summary>
        ''' The current state of the Standby LED
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property StandbyLED As LedStatus
            Get
                Return m_StandbyLED
            End Get
            Set(ByVal value As LedStatus)
                m_StandbyLED = value
            End Set
        End Property

        ''' <summary>
        ''' The current state of the Operate LED
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property OperateLED As LedStatus
            Get
                Return m_OperateLED
            End Get
            Set(ByVal value As LedStatus)
                m_OperateLED = value
            End Set
        End Property

        ''' <summary>
        ''' The current state of the Drive LED
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property DriveLED As LedStatus
            Get
                Return m_DriveLED
            End Get
            Set(ByVal value As LedStatus)
                m_DriveLED = value
            End Set
        End Property

        ''' <summary>
        ''' The current state of the Plate LED
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property PlateLED As LedStatus
            Get
                Return m_PlateLED
            End Get
            Set(ByVal value As LedStatus)
                m_PlateLED = value
            End Set
        End Property

        ''' <summary>
        ''' The current state of the Power LED
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property PowerLED As LedStatus
            Get
                Return m_PowerLED
            End Get
            Set(ByVal value As LedStatus)
                m_PowerLED = value
            End Set
        End Property

        ''' <summary>
        ''' The Current Operate mode of the amplifier
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property OperateMode As OperateMode
            Get
                Return m_OperateMode
            End Get
            Set(ByVal value As OperateMode)
                m_OperateMode = value
            End Set
        End Property

        ''' <summary>
        ''' The current air temperature
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property CurrentAirTemp As Integer
            Get
                Return m_CurrentAirTemp
            End Get
            Set(ByVal value As Integer)
                m_CurrentAirTemp = value
            End Set
        End Property

        ''' <summary>
        ''' The Power/Connection state of the amplifier
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property PowerState As PowerState
            Get
                Return m_PowerState
            End Get
            Set(ByVal value As PowerState)
                m_PowerState = value
            End Set
        End Property

        ''' <summary>
        ''' The Power/Connection state of the amplifier prior to an amplifier error being generated
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property PowerStatePriorToError As PowerState
            Get
                Return m_PowerStatePriorToError
            End Get
            Set(ByVal value As PowerState)
                m_PowerStatePriorToError = value
            End Set
        End Property

        ''' <summary>
        ''' The Amplifier's current band segment
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property Segment As BandSegment
            Get
                Return m_Segment
            End Get
            Set(ByVal value As BandSegment)
                m_Segment = value
            End Set
        End Property

        ''' <summary>
        ''' The Amplifier's current antenna number
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property AntennaNumber As Integer
            Get
                Return m_AntennaNumber
            End Get
            Set(ByVal value As Integer)
                m_AntennaNumber = value
            End Set
        End Property

        ''' <summary>
        ''' True if the Amplifier is using USR settings, False if DEF is being used
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property USRMode As Boolean
            Get
                Return m_USRMode
            End Get
            Set(ByVal value As Boolean)
                m_USRMode = value
            End Set
        End Property

        ''' <summary>
        ''' The Amplifier's current band
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property Band As FrequencyBand
            Get
                Return m_Band
            End Get
            Set(ByVal value As FrequencyBand)
                m_Band = value
            End Set
        End Property

        ''' <summary>
        ''' The First Matrix Display text line for the current error message
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property CurrentErrorMessageLine1 As String
            Get
                Return m_CurrentErrorMessageLine1
            End Get
            Set(ByVal value As String)
                m_CurrentErrorMessageLine1 = value
            End Set
        End Property

        ''' <summary>
        ''' The Second Matrix Display text line for the current error message
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property CurrentErrorMessageLine2 As String
            Get
                Return m_CurrentErrorMessageLine2
            End Get
            Set(ByVal value As String)
                m_CurrentErrorMessageLine2 = value
            End Set
        End Property

        ''' <summary>
        ''' The current value of line 1 of the Matrix Display
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property DisplayLine1 As String
            Get
                Return m_DisplayLine1
            End Get
            Set(ByVal value As String)
                m_DisplayLine1 = value
            End Set
        End Property

        ''' <summary>
        ''' The current value of line 2 of the Matrix Display
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property DisplayLine2 As String
            Get
                Return m_DisplayLine2
            End Get
            Set(ByVal value As String)
                m_DisplayLine2 = value
            End Set
        End Property

        ''' <summary>
        ''' The current value of line 3 of the Matrix Display
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property DisplayLine3 As String
            Get
                Return m_DisplayLine3
            End Get
            Set(ByVal value As String)
                m_DisplayLine3 = value
            End Set
        End Property

        ''' <summary>
        ''' The current value of line 4 of the Matrix Display
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property DisplayLine4 As String
            Get
                Return m_DisplayLine4
            End Get
            Set(ByVal value As String)
                m_DisplayLine4 = value
            End Set
        End Property

        ''' <summary>
        ''' True if the amplifier is in measurement mode
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property IsMeasuring As Boolean
            Get
                Return m_IsMeasuring
            End Get
            Set(ByVal value As Boolean)
                m_IsMeasuring = value
            End Set
        End Property

        ''' <summary>
        ''' The first metric to measure
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property MetricA As MeasurementMetricType
            Get
                Return m_MetricA
            End Get
            Set(ByVal value As MeasurementMetricType)
                m_MetricA = value
            End Set
        End Property

        ''' <summary>
        ''' The second metric to measure
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property MetricB As MeasurementMetricType
            Get
                Return m_MetricB
            End Get
            Set(ByVal value As MeasurementMetricType)
                m_MetricB = value
            End Set
        End Property

        ''' <summary>
        ''' The current value of the first measured metric
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property MetricAValue As String
            Get
                Return m_MetricAValue
            End Get
            Set(ByVal value As String)
                m_MetricAValue = value
            End Set
        End Property

        ''' <summary>
        ''' The current value of the second measured metric
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <DataMember()> _
        Public Property MetricBValue As String
            Get
                Return m_MetricBValue
            End Get
            Set(ByVal value As String)
                m_MetricBValue = value
            End Set
        End Property

#End Region

    End Class

End Namespace